package com.blog.base;

/**
 * @author 任浩
 * @version 1.0
 */
public class ThreadLocalToken {
    /**
     * 这是匿名内部类的写法
     */
    private static final ThreadLocal<String> threadLocal = new ThreadLocal<>(){
        @Override
        protected String initialValue() {
            return null;
        }
    };

    public static String get(){
        return threadLocal.get();
    }

    public static void set(String value){
        threadLocal.set(value);
    }

    public static void remove(){
        threadLocal.remove();
    }
}
